import java.util.Arrays;

public class aa {


    public static void main(String[] args) {
        method();
        method1();
        method2();
        method3();


    }

    private static void method3() {
        int arr2[][] = {{4, 3}, {1, 2}};
        System.out.println("数组中的元素是：");
        int a = 0;
        for (int x[] : arr2) {
            a++;
            int j = 0;
            for (int e : x) {
                j++;
                if (a == arr2.length && j == x.length) {
                    System.out.println(e);
                } else {
                    System.out.println(e + "、");
                }
            }
        }

        public static void method2 () {
            int b[][] = new int[][]{{1}, {2, 3}, {4, 5, 6}};
            for (int i = 0; i < b.length; i++) {
                for (int j = 0; j < b[i].length; j++) {
                    System.out.print(b[i][j]);
                }
                System.out.println();
            }
        }


        private static void method1(){
            char arr[][] = new char[4][];
            arr[0] = new char[]{'春', '眠', '不', '觉', '晓'};
            arr[1] = new char[]{'处', '处', '闻', '啼', '鸟'};
            arr[2] = new char[]{'夜', '来', '风', '雨', '声'};
            arr[3] = new char[]{'花', '落', '知', '多', '少'};
            System.out.println("----------横版------------");
            for (int i = 0; i < arr.length; i++) {
                for (int j = 0; j < arr[i].length; j++) {
                    System.out.print(arr[i][j]);
                }
                if (i % 2 == 0) {
                    System.out.println(',');
                } else {
                    System.out.println('.');
                }
            }
            System.out.println("-------竖版");
            for (int j = 0; j < arr[0].length; j++) {
                for (int i = 3; i >= 0; i--) {
                    System.out.print(arr[i][j]);
                }
                System.out.println();

            }
            System.out.println("。，。，");
        }
    }
}